home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / VECTBAL2.ZIP / XLIB.H < prev    next >
C/C++ Source or Header  |  1994-07-15  |  6KB  |  163 lines

  1. /*----------------------------------------------------------------------
  2. ;
  3. ; XLIB - header file
  4. ;
  5. ;
  6. ;
  7. ; ****** XLIB - Mode X graphics library                ****************
  8. ; ******                                               ****************
  9. ; ****** Written By Themie Gouthas                     ****************
  10. ;
  11. ; egg@dstos3.dsto.gov.au
  12. ; teg@bart.dsto.gov.au
  13. ;
  14. ; Header file contributed by Darren Lyon (darren@nicky.DIALix.oz.au)
  15. ;
  16. ;
  17. ;  Terminology & notes:
  18. ;         VRAM ==   Video RAM
  19. ;         SRAM ==   System RAM
  20. ;         X coordinates are in pixels unless explicitly stated
  21. ;
  22. ;----------------------------------------------------------------------*/
  23.  
  24. #ifndef _XLIB_H_
  25. #define _XLIB_H_
  26.  
  27. #define BYTE unsigned char
  28. #define WORD unsigned int
  29.  
  30.  
  31. #define X_MODE_320x200  0
  32. #define X_MODE_320x240  1
  33. #define X_MODE_360x200  2
  34. #define X_MODE_360x240  3
  35. #define X_MODE_376x282  4
  36. #define X_MODE_320x400  5
  37. #define X_MODE_320x480  6
  38. #define X_MODE_360x400  7
  39. #define X_MODE_360x480  8
  40. #define X_MODE_360x360  9
  41. #define X_MODE_376x308  10
  42. #define X_MODE_376x564  11
  43. #define X_MODE_256x400  12
  44. #define X_MODE_256x480  13
  45.  
  46.  
  47. #define BACKWARD 0
  48. #define FORWARD  1
  49.  
  50. #define X_MODE_INVALID  -1
  51. #define ERROR            1
  52. #define OK               0
  53.  
  54. /* FUNCTIONS =========================================================== */
  55.  
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif
  59.  
  60.  WORD x_set_mode(
  61.         WORD mode,                /* Initialize x mode           */
  62.         WORD WidthInPixels);
  63.  
  64.   void x_select_default_plane( /*Enables Read/Write access to a    */
  65.         BYTE plane);   /* a specified plane                */
  66.  
  67.  void x_set_splitscreen(            /* set the split screen start  */
  68.         WORD line);         /*scan line (initialize)       */
  69.  
  70.  void x_set_start_addr(
  71.         WORD X,             /* Set the screen start        */
  72.         WORD Y);            /* address in video ram        */
  73.  
  74.  void x_hide_splitscreen(void); /* Disable the split screen (Split */
  75.                 /* Screen RAM remains reserved)    */
  76.  
  77.  void x_show_splitscreen(void); /* Enable the split screen (given it */
  78.                 /* was previously "hidden")          */
  79.  
  80.  
  81.  void x_adjust_splitscreen(   /* Adjust the start scan line of the */
  82.         WORD line);   /* split screen                      */
  83.  
  84.  
  85.  WORD x_set_doublebuffer(         /* Enable double buffering with a    */
  86.         WORD PageHeight); /* specified page height             */
  87.  
  88.  WORD x_set_tripplebuffer(         /* Enable tripple buffering with a    */
  89.                 WORD PageHeight); /* specified page height             */
  90.  
  91.  
  92.  void x_page_flip(        /* Swap visible page (only when double   */
  93.         WORD X,   /* buffering is active) & sets virt start*/
  94.         WORD Y);
  95.  
  96.  void x_set_cliprect(      /* Define the clipping rectangle */
  97.         WORD left, /* NOTE: left and right are in bytes */
  98.         WORD top,
  99.         WORD righ,
  100.         WORD bottom);
  101.  
  102.  void x_text_mode(void);   /* return to text mode */
  103.  void x_wait_vsync(void);  /* wait for vsync */
  104.  
  105. #ifdef __cplusplus
  106. }
  107. #endif
  108.  
  109.  
  110. /* VARIABLES =========================================================== */
  111.  
  112. extern BYTE InGraphics;             /* non zero if in X graphics mode      */
  113. extern WORD CurrXMode;              /* contains current X graphics mode id */
  114. extern WORD ScrnPhysicalByteWidth;  /* Physical screen width in bytes      */
  115. extern WORD ScrnPhysicalPixelWidth; /* Physical screen width in pixels     */
  116. extern WORD ScrnPhysicalHeight;     /* Physical screen height in pixels    */
  117. extern WORD ErrorValue;             /* Error return value                  */
  118. extern WORD SplitScrnOffs;          /* Offset in VRAM  of split screen     */
  119. extern WORD SplitScrnScanLine;      /* Scan line split screen starts at    */
  120.                     /* initially. Resizing the split scrn  */
  121.                     /* using the other functions does not  */
  122.                     /* change this value                   */
  123. extern WORD SplitScrnVisibleHeight; /* Height of the visible portion of the*/
  124.                     /* split screen.                       */
  125. extern WORD Page0_Offs;             /* Offset in VRAM of main virt. screen */
  126. extern WORD Page1_Offs;             /* Offset in VRAM of 2nd virt. screen  */
  127. extern WORD Page2_Offs;             /* Offset in VRAM of 3rd virt. screen  */
  128. extern WORD ScrnLogicalByteWidth;   /* Virtual screen width in bytes       */
  129. extern WORD ScrnLogicalPixelWidth;  /* Virtual screen width in pixels      */
  130. extern WORD ScrnLogicalHeight;      /* Virtual screen height in pixels     */
  131. extern WORD MaxScrollX;             /* Max X position of physical screen   */
  132.                     /*  within virtual screen              */
  133. extern WORD MaxScrollY;             /* Max Y position of physical screen   */
  134.                     /*  within virtual screen              */
  135. extern WORD DoubleBufferActive;     /* Indicates whether double buffering  */
  136.                                     /* is active                           */
  137. extern WORD TrippleBufferActive;    /* Indicates whether tripple           */
  138.                     /* buffering is active                 */
  139. extern WORD VisiblePageIdx;         /* Index number of visible page 0 or 1 */
  140. extern WORD HiddenPageOffs;         /* Offset of Hidden Pg | only valid    */
  141. extern WORD VisiblePageOffs;        /* Offset of Visible Pg| for D.B. mode */
  142. extern WORD WaitingPageOffs;        /* Offset of Waiting Pg| for T.B. mode */
  143. extern WORD NonVisual_Offs;         /* Offset of first non-visible VRAM    */
  144.  
  145. extern WORD StartAddressFlag;
  146.  
  147. extern WORD TopClip;                /* Clipping rectangle                  */
  148. extern WORD BottomClip;
  149. extern WORD LeftClip;
  150. extern WORD RightClip;
  151.  
  152. extern WORD PhysicalStartPixelX;    /* Coordinates of physical (visible) */
  153. extern WORD PhysicalStartByteX;     /* screen relative to the virtual    */
  154. extern WORD PhysicalStartY;         /* screen's U.L. corner              */
  155.  
  156. extern char* VsyncPaletteBuffer;
  157.  
  158. extern WORD SCREEN_SEG;
  159.  
  160. #endif
  161.  
  162.  
  163.